<html
        xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:composite="http://java.sun.com/jsf/composite"
        xmlns:cc="http://java.sun.com/jsf/composite/cc"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:c="http://java.sun.com/jsp/jstl/core">

<!-- INTERFACE -->
<composite:interface>
    <composite:attribute name="bean" required="true" shortDescription="The MenuModel instance"/>
</composite:interface>

<!-- IMPLEMENATION -->
<composite:implementation>
    <h:form prependId="false">
        <p:menubar widgetVar="t">
            <c:forEach items="${cc.attrs.bean.menu.subMenus}" var="subMenu" varStatus="subMenuStatus">
                <p:submenu label="#{subMenu.text}">
                    <c:forEach items="${subMenu.menuItems}" var="menuItem" varStatus="menuItemStatus">
                        <p:menuitem value="#{menuItem.text}"  url="#{menuItem.url}" />
                    </c:forEach>
                </p:submenu>
            </c:forEach>
        </p:menubar>
    </h:form>
</composite:implementation>
</html>